package com.ruoyi.admin.controller;

import com.ruoyi.app.domain.TripInfo;
import com.ruoyi.app.service.HomeService;
import com.ruoyi.app.service.PermissionService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/*
@description:行程
@ClassName TripController
@author chen
@create 2025-04-07 16:29
@Version 1.0
*/
@Slf4j
@RestController
@RequestMapping("trip")
@AllArgsConstructor
public class TripController extends BaseController
{
    final HomeService homeService;
    final PermissionService permissionService;

    @GetMapping(value = "/getTripInfoList",produces = "application/json;charset=utf-8")
    public TableDataInfo getTripInfoList(@RequestParam Map<String, Object> params)
    {
        startPage();
        List<TripInfo> list = homeService.getTripInfoList(params);
        return getDataTable(list);
    }


    @GetMapping(value = "/getTripInfo",produces = "application/json;charset=utf-8")
    public AjaxResult getTripInfo(@RequestParam Map<String, Object> params)
    {
        return AjaxResult.success(homeService.getTripInfo(params));
    }


    @DeleteMapping(value = "/deleteTripInfo",produces = "application/json;charset=utf-8")
    public AjaxResult deleteTripInfo(@RequestParam Long id)
    {
        return permissionService.deleteTripInfo(id);
    }


}
